<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<return>
			<main>
				<xsl:for-each select="insupost-response">
					<transNo>
						<xsl:value-of select="response-head/trans-id"/>
					</transNo>
					<resultCode>
						<xsl:value-of select="concat('000',string(response-head/trans-result))"/>
					</resultCode>
					<resultMsgs>
						<xsl:for-each select="response-head/validity-errors/validity-error">
							<resultMsg>
								<xsl:value-of select="error-desc"/>
							</resultMsg>
						</xsl:for-each>
					</resultMsgs>
					<xsl:choose>
						<xsl:when test="response-head/trans-type ='104'">
							<uwPass>
								<xsl:value-of select="response-underwriting/uw-result"/>
							</uwPass>
							<totalPremium>
								<xsl:choose>
									<xsl:when test="response-head/trans-result = 0">
										<xsl:value-of select="response-underwriting/uw-policy/discount-prem"/>元
    </xsl:when>
								</xsl:choose>
							</totalPremium>
						</xsl:when>
						<xsl:when test="response-head/trans-type = '102'">
							<!--<xsl:choose>
			<xsl:when test="response-policy-issue = null">
			<proposalState><xsl:value-of select="response-underwriting/uw-policy/p-state"/></proposalState>
			 <uwPass><xsl:value-of select="response-underwriting/uw-result"/></uwPass>
			</xsl:when>
			<xsl:otherwise>-->
							<proposalState>
								<xsl:value-of select="response-policy-issue/policy-print/policy-info/proposal-status"/>
							</proposalState>
							<uwPass>
								<xsl:value-of select="response-policy-issue/uw-result"/>
							</uwPass>
							<!--</xsl:otherwise>
 </xsl:choose>-->
						</xsl:when>
						<xsl:when test="response-head/trans-type = '106'">
							<proposalState>
								<xsl:value-of select="response-policy-query/policy-query-info-list/policy-query-info/policy-info/proposal-status"/>
							</proposalState>
							<policyState>
								<xsl:value-of select="response-policy-query/policy-query-info-list/policy-query-info/policy-info/policy-status"/>
							</policyState>
							<uwLetter>
								<xsl:value-of select="response-policy-query/policy-query-info-list/policy-query-info/policy-info/uw-letter"/>
							</uwLetter>
						</xsl:when>
						<xsl:otherwise/>
					</xsl:choose>
				</xsl:for-each>
			</main>
			<xsl:choose>
				<xsl:when test="insupost-response/response-head/trans-type = '102' and insupost-response/response-policy-issue/policy-print/policy-info/proposal-status = 85">
					<xsl:for-each select="insupost-response/response-policy-issue/policy-print/policy-info">
						<policyPrint>
							<agents>
								<agent>
									<agentCode>
										<xsl:value-of select="agent-code"/>
									</agentCode>
									<agentName>
										<xsl:value-of select="agent-name"/>
									</agentName>
								</agent>
							</agents>
							<policyHolders>
								<xsl:for-each select="policy-holder">
									<policyHolder>
										<phName>
											<xsl:value-of select="real-name"/>
										</phName>
										<phGender>
											<xsl:call-template name="gender">
												<xsl:with-param name="srcGender" select="gender"/>
											</xsl:call-template>
										</phGender>
										<phDob>
											<xsl:value-of select="concat(substring(string(birthday),1,4),'年',substring(string(birthday),5,2),'月',substring(string(birthday),7,2),'日')"/>
										</phDob>
										<phMobile>
											<xsl:value-of select="mobile-phone"/>
										</phMobile>
										<phTel>
											<xsl:value-of select="day-phone"/>
										</phTel>
										<idNo>
											<xsl:value-of select="certi-code"/>
										</idNo>
										<phAddress>
											<xsl:value-of select="rela-address"/>
										</phAddress>
										<phPostCode>
											<xsl:value-of select="rela-zip"/>
										</phPostCode>
									</policyHolder>
								</xsl:for-each>
							</policyHolders>
							<insuredList>
								<xsl:for-each select="life-assureds/life-assured">
									<insured>
										<insuredName>
											<xsl:value-of select="real-name"/>
										</insuredName>
										<insuredGender>
											<xsl:call-template name="gender">
												<xsl:with-param name="srcGender" select="gender"/>
											</xsl:call-template>
										</insuredGender>
										<insuredDob>
											<xsl:value-of select="concat(substring(string(birthday),1,4),'年',substring(string(birthday),5,2),'月',substring(string(birthday),7,2),'日')"/>
										</insuredDob>
										<idNo>
											<xsl:value-of select="certi-code"/>
										</idNo>
									</insured>
								</xsl:for-each>
							</insuredList>
							<beneficiaries>
								<xsl:for-each select="beneficiaries/beneficiary">
									<benericiary>
										<beneName>
											<xsl:value-of select="real-name"/>
										</beneName>
										<beneIdNo>
											<xsl:value-of select="certi-code"/>
										</beneIdNo>
										<beneOrder>
											<xsl:value-of select="bene-order"/>
										</beneOrder>
										<beneShare>
											<xsl:value-of select="concat(bene-rate*100,'%')"/>
										</beneShare>
									</benericiary>
								</xsl:for-each>
							</beneficiaries>
							<policys>
								<policy>
									<policyCode>
										<xsl:value-of select="policy-code"/>
									</policyCode>
									<policyOrg>
										<xsl:value-of select="organ-id"/>
									</policyOrg>
									<branchName>
										<xsl:value-of select="carrier-name"/>
									</branchName>
									<branchAddress>
										<xsl:value-of select="carrier-address"/>
									</branchAddress>
									<insuredName>
										<xsl:value-of select="life-assureds/life-assured/real-name"/>
									</insuredName>
									<insuredGender>
										<xsl:call-template name="gender">
											<xsl:with-param name="srcGender" select="life-assureds/life-assured/gender"/>
										</xsl:call-template>
									</insuredGender>
									<insurdeAge>
										<xsl:value-of select="concat(string(life-assureds/life-assured/age),'周岁')"/>
									</insurdeAge>
									<ridersCount>
										<xsl:value-of select="count(products/product)-1"/>
									</ridersCount>
									<totalPremium>
										<xsl:value-of select="policy-prem"/>元</totalPremium>
									<totalPremiumWord>
										<xsl:value-of select="policy-prem-cn"/>
									</totalPremiumWord>
									<xsl:for-each select="products/product">
										<xsl:choose>
											<xsl:when test="ins-type = 1">
												<xsl:choose>
													<xsl:when test="substring(string(/insupost-response/response-policy-issue/policy-print/policy-info/apply-code),16,2) = '37'">
														<planId>
															<xsl:value-of select="pkg-code"/>
														</planId>
														<planName>
															<xsl:value-of select="pkg-name"/>
														</planName>
													</xsl:when>
													<xsl:otherwise>
														<planId/>
														<planName>
															<xsl:value-of select="product-name"/>
														</planName>
													</xsl:otherwise>
												</xsl:choose>
												<issuedate>
													<xsl:value-of select="concat(substring(string(apply-date),1,4),'年',substring(string(apply-date),5,2),'月',substring(string(apply-date),7,2),'日')"/>
												</issuedate>
												<commencementDate>
													<xsl:value-of select="concat(substring(string(validate-date),1,4),'年',substring(string(validate-date),5,2),'月',substring(string(validate-date),7,2),'日')"/>
												</commencementDate>
												<xsl:choose>
													<xsl:when test="substring(string(/insupost-response/response-policy-issue/policy-print/policy-info/apply-code),16,2) = '37'">
														<basicPlanFullCode>
															<xsl:value-of select="product-num"/>
														</basicPlanFullCode>
													</xsl:when>
													<xsl:otherwise>
														<basicPlanFullCode>
															<xsl:value-of select="product-code"/>
														</basicPlanFullCode>
													</xsl:otherwise>
												</xsl:choose>
												<basicPlanFullName>
													<xsl:value-of select="product-name"/>
												</basicPlanFullName>
												<deductible>
													<xsl:value-of select="deduct-info"/>
												</deductible>
												<paymentRate>
													<xsl:choose>
														<xsl:when test="pay-rate != 0">
															<xsl:value-of select="concat(pay-rate*100,'%')"/>
														</xsl:when>
													</xsl:choose>
												</paymentRate>
												<universal>
													<xsl:value-of select="is-universal"/>
												</universal>
												<xsl:choose>
													<xsl:when test="initial-rate = '0'">
														<initialRate/>
													</xsl:when>
													<xsl:otherwise>
														<initialRate>
															<xsl:value-of select="concat(initial-rate *100,'%')"/>
														</initialRate>
													</xsl:otherwise>
												</xsl:choose>
												<policyFee>
													<xsl:value-of select="charge-fee"/>元</policyFee>
												<sumAssured>
													<xsl:value-of select="amount"/>元</sumAssured>
												<units>
													<xsl:choose>
														<xsl:when test="unit = 0"/>
														<xsl:otherwise>
															<xsl:value-of select="unit"/>份
	</xsl:otherwise>
													</xsl:choose>
												</units>
												<coveragePeriod>
													<xsl:call-template name="coveragePeriod">
														<xsl:with-param name="srcCoveragePeriod" select="coverage-period"/>
														<xsl:with-param name="srcCoverageYear" select="coverage-year"/>
													</xsl:call-template>
												</coveragePeriod>
												<paymentPeriod>
													<xsl:call-template name="paymentPeriod">
														<xsl:with-param name="srcChargePeriod" select="charge-period"/>
														<xsl:with-param name="srcChargeYear" select="charge-year"/>
													</xsl:call-template>
												</paymentPeriod>
												<paymentFrequency>
													<xsl:call-template name="payFrequency">
														<xsl:with-param name="srcPayFrequency" select="initial-type"/>
													</xsl:call-template>
												</paymentFrequency>
												<topup>
													<xsl:choose>
														<xsl:when test="total-topup-prem = 0"/>
														<xsl:otherwise>
															<xsl:value-of select="total-topup-prem"/>元</xsl:otherwise>
													</xsl:choose>
												</topup>
												<masterPremium>
													<xsl:value-of select="discount-prem"/>元</masterPremium>
												<xsl:choose>
													<xsl:when test="product-cashvalues/product-cashvalue/cash-value != ''">
														<hasCashValues>Y</hasCashValues>
														<cashCount>
															<xsl:value-of select="count(product-cashvalues/product-cashvalue)"/>
														</cashCount>
													</xsl:when>
													<xsl:otherwise>
														<hasCashValues>N</hasCashValues>
														<cashCount>0</cashCount>
													</xsl:otherwise>
												</xsl:choose>
												<cashValues>
													<xsl:for-each select="product-cashvalues/product-cashvalue">
														<cashValue>
															<endYear>
																<xsl:value-of select="cash-year"/>
															</endYear>
															<svCash>
																<xsl:value-of select="cash-value"/>
															</svCash>
														</cashValue>
													</xsl:for-each>
												</cashValues>
												<xsl:choose>
													<xsl:when test="product-cashvalues/rbIndicator = 'Y'">
														<hasRbBenefit>Y</hasRbBenefit>
														<benefitCount>
															<xsl:value-of select="count(product-cashvalues/product-cashvalue)"/>
														</benefitCount>
														<rbBenefits>
															<xsl:for-each select="product-cashvalues/product-cashvalue">
																<rbBenefit>
																	<endYear>
																		<xsl:value-of select="cash-year"/>
																	</endYear>
																	<rbRate>
																		<xsl:value-of select="rb-cash-value"/>
																	</rbRate>
																</rbBenefit>
															</xsl:for-each>
														</rbBenefits>
													</xsl:when>
													<xsl:otherwise>
														<hasRbBenefit>N</hasRbBenefit>
														<benefitCount>0</benefitCount>
														<rbBenefits> 
	</rbBenefits>
													</xsl:otherwise>
												</xsl:choose>
											</xsl:when>
										</xsl:choose>
									</xsl:for-each>
								</policy>
							</policys>
							<riders>
								<xsl:for-each select="products/product">
									<xsl:choose>
										<xsl:when test="ins-type != 1">
											<rider>
												<universal>
													<xsl:value-of select="is-universal"/>
												</universal>
												<xsl:choose>
													<xsl:when test="substring(string(/insupost-response/response-policy-issue/policy-print/policy-info/apply-code),16,2) = '37'">
														<productCode>
															<xsl:value-of select="product-num"/>
														</productCode>
													</xsl:when>
													<xsl:otherwise>
														<productCode>
															<xsl:value-of select="product-code"/>
														</productCode>
													</xsl:otherwise>
												</xsl:choose>
												<productName>
													<xsl:value-of select="product-name"/>
												</productName>
												<deductible>
													<xsl:value-of select="deduct-info"/>
												</deductible>
												<paymentRate>
													<xsl:value-of select="concat(pay-rate*100,'%')"/>
												</paymentRate>
												<sa>
													<xsl:value-of select="amount"/>元</sa>
												<units>
													<xsl:value-of select="unit"/>份</units>
												<topup>
													<xsl:value-of select="total-topup-prem"/>元</topup>
												<riderPremium>
													<xsl:value-of select="discount-prem"/>元</riderPremium>
												<coveragePeriod>
													<xsl:call-template name="coveragePeriod">
														<xsl:with-param name="srcCoveragePeriod" select="coverage-period"/>
														<xsl:with-param name="srcCoverageYear" select="coverage-year"/>
													</xsl:call-template>
												</coveragePeriod>
												<paymentPeriod>
													<xsl:call-template name="paymentPeriod">
														<xsl:with-param name="srcChargePeriod" select="charge-period"/>
														<xsl:with-param name="srcChargeYear" select="charge-year"/>
													</xsl:call-template>
												</paymentPeriod>
												<xsl:choose>
													<xsl:when test="product-cashvalues/product-cashvalue/cash-value != ''">
														<hasCashValues>Y</hasCashValues>
														<cashCount>
															<xsl:value-of select="count(product-cashvalues/product-cashvalue)"/>
														</cashCount>
													</xsl:when>
													<xsl:otherwise>
														<hasCashValues>N</hasCashValues>
														<cashCount>0</cashCount>
													</xsl:otherwise>
												</xsl:choose>
												<cashValues>
													<xsl:for-each select="product-cashvalues/product-cashvalue">
														<cashValue>
															<endYear>
																<xsl:value-of select="cash-year"/>
															</endYear>
															<svCash>
																<xsl:value-of select="cash-value"/>
															</svCash>
														</cashValue>
													</xsl:for-each>
												</cashValues>
												<xsl:choose>
													<xsl:when test="product-cashvalues/rbIndicator = 'Y'">
														<hasRbBenefit>Y</hasRbBenefit>
														<benefitCount>
															<xsl:value-of select="count(product-cashvalues/product-cashvalue)"/>
														</benefitCount>
														<rbBenefits>
															<xsl:for-each select="product-cashvalues/product-cashvalue">
																<rbBenefit>
																	<endYear>
																		<xsl:value-of select="cash-year"/>
																	</endYear>
																	<rbRate>
																		<xsl:value-of select="rb-cash-value"/>
																	</rbRate>
																</rbBenefit>
															</xsl:for-each>
														</rbBenefits>
													</xsl:when>
													<xsl:otherwise>
														<hasRbBenefit>N</hasRbBenefit>
														<benefitCount>0</benefitCount>
														<rbBenefits> 
	</rbBenefits>
													</xsl:otherwise>
												</xsl:choose>
											</rider>
										</xsl:when>
									</xsl:choose>
								</xsl:for-each>
							</riders>
							<twoDimenCode>
								<xsl:value-of select="two-dimen-code"/>
							</twoDimenCode>
						</policyPrint>
					</xsl:for-each>
				</xsl:when>
				<xsl:when test="insupost-response/response-head/trans-type = '106'">
					<xsl:for-each select="insupost-response/response-policy-query/policy-query-info-list/policy-query-info/policy-info">
						<policyPrint>
							<agents>
								<agent>
									<agentCode>
										<xsl:value-of select="agent-code"/>
									</agentCode>
									<agentName>
										<xsl:value-of select="agent-name"/>
									</agentName>
								</agent>
							</agents>
							<policyHolders>
								<xsl:for-each select="policy-holder">
									<policyHolder>
										<phName>
											<xsl:value-of select="real-name"/>
										</phName>
										<phGender>
											<xsl:call-template name="gender">
												<xsl:with-param name="srcGender" select="gender"/>
											</xsl:call-template>
										</phGender>
										<phDob>
											<xsl:value-of select="concat(substring(string(birthday),1,4),'年',substring(string(birthday),5,2),'月',substring(string(birthday),7,2),'日')"/>
										</phDob>
										<phMobile>
											<xsl:value-of select="mobile-phone"/>
										</phMobile>
										<phTel>
											<xsl:value-of select="day-phone"/>
										</phTel>
										<idNo>
											<xsl:value-of select="certi-code"/>
										</idNo>
										<phAddress>
											<xsl:value-of select="rela-address"/>
										</phAddress>
										<phPostCode>
											<xsl:value-of select="rela-zip"/>
										</phPostCode>
									</policyHolder>
								</xsl:for-each>
							</policyHolders>
							<insuredList>
								<xsl:for-each select="life-assureds/life-assured">
									<insured>
										<insuredName>
											<xsl:value-of select="real-name"/>
										</insuredName>
										<insuredGender>
											<xsl:call-template name="gender">
												<xsl:with-param name="srcGender" select="gender"/>
											</xsl:call-template>
										</insuredGender>
										<insuredDob>
											<xsl:value-of select="concat(substring(string(birthday),1,4),'年',substring(string(birthday),5,2),'月',substring(string(birthday),7,2),'日')"/>
										</insuredDob>
										<idNo>
											<xsl:value-of select="certi-code"/>
										</idNo>
									</insured>
								</xsl:for-each>
							</insuredList>
							<beneficiaries>
								<xsl:for-each select="beneficiaries/beneficiary">
									<benericiary>
										<beneName>
											<xsl:value-of select="real-name"/>
										</beneName>
										<beneIdNo>
											<xsl:value-of select="certi-code"/>
										</beneIdNo>
										<beneOrder>
											<xsl:value-of select="bene-order"/>
										</beneOrder>
										<beneShare>
											<xsl:value-of select="concat(bene-rate*100,'%')"/>
										</beneShare>
									</benericiary>
								</xsl:for-each>
							</beneficiaries>
							<policys>
								<policy>
									<policyCode>
										<xsl:value-of select="policy-code"/>
									</policyCode>
									<policyOrg>
										<xsl:value-of select="organ-id"/>
									</policyOrg>
									<branchName>
										<xsl:value-of select="carrier-name"/>
									</branchName>
									<branchAddress>
										<xsl:value-of select="carrier-address"/>
									</branchAddress>
									<insuredName>
										<xsl:value-of select="life-assureds/life-assured/real-name"/>
									</insuredName>
									<insuredGender>
										<xsl:call-template name="gender">
											<xsl:with-param name="srcGender" select="life-assureds/life-assured/gender"/>
										</xsl:call-template>
									</insuredGender>
									<insurdeAge>
										<xsl:value-of select="concat(string(life-assureds/life-assured/age),'周岁')"/>
									</insurdeAge>
									<ridersCount>
										<xsl:value-of select="count(products/product)-1"/>
									</ridersCount>
									<totalPremium>
										<xsl:value-of select="policy-prem"/>元</totalPremium>
									<totalPremiumWord>
										<xsl:value-of select="policy-prem-cn"/>
									</totalPremiumWord>
									<xsl:for-each select="products/product">
										<xsl:choose>
											<xsl:when test="ins-type = 1">
												<xsl:choose>
													<xsl:when test="substring(string(/insupost-response/response-policy-query/policy-query-info-list/policy-query-info/policy-info/apply-code),16,2) = '37'">
														<planId>
															<xsl:value-of select="pkg-code"/>
														</planId>
														<planName>
															<xsl:value-of select="pkg-name"/>
														</planName>
													</xsl:when>
													<xsl:otherwise>
														<planId/>
														<planName>
															<xsl:value-of select="product-name"/>
														</planName>
													</xsl:otherwise>
												</xsl:choose>
												<issuedate>
													<xsl:value-of select="concat(substring(string(apply-date),1,4),'年',substring(string(apply-date),5,2),'月',substring(string(apply-date),7,2),'日')"/>
												</issuedate>
												<commencementDate>
													<xsl:value-of select="concat(substring(string(validate-date),1,4),'年',substring(string(validate-date),5,2),'月',substring(string(validate-date),7,2),'日')"/>
												</commencementDate>
												<xsl:choose>
													<xsl:when test="substring(string(/insupost-response/response-policy-query/policy-query-info-list/policy-query-info/policy-info/apply-code),16,2) = '37'">
														<basicPlanFullCode>
															<xsl:value-of select="product-num"/>
														</basicPlanFullCode>
													</xsl:when>
													<xsl:otherwise>
														<basicPlanFullCode>
															<xsl:value-of select="product-code"/>
														</basicPlanFullCode>
													</xsl:otherwise>
												</xsl:choose>
												<basicPlanFullName>
													<xsl:value-of select="product-name"/>
												</basicPlanFullName>
												<deductible>
													<xsl:value-of select="deduct-info"/>
												</deductible>
												<paymentRate>
													<xsl:choose>
														<xsl:when test="pay-rate != 0">
															<xsl:value-of select="concat(pay-rate*100,'%')"/>
														</xsl:when>
													</xsl:choose>
												</paymentRate>
												<universal>
													<xsl:value-of select="is-universal"/>
												</universal>
												<xsl:choose>
													<xsl:when test="initial-rate = '0'">
														<initialRate/>
													</xsl:when>
													<xsl:otherwise>
														<initialRate>
															<xsl:value-of select="concat(initial-rate *100,'%')"/>
														</initialRate>
													</xsl:otherwise>
												</xsl:choose>
												<policyFee>
													<xsl:value-of select="charge-fee"/>元</policyFee>
												<sumAssured>
													<xsl:value-of select="amount"/>元</sumAssured>
												<units>
													<xsl:choose>
														<xsl:when test="unit = 0"/>
														<xsl:otherwise>
															<xsl:value-of select="unit"/>份
	</xsl:otherwise>
													</xsl:choose>
												</units>
												<coveragePeriod>
													<xsl:call-template name="coveragePeriod">
														<xsl:with-param name="srcCoveragePeriod" select="coverage-period"/>
														<xsl:with-param name="srcCoverageYear" select="coverage-year"/>
													</xsl:call-template>
												</coveragePeriod>
												<paymentPeriod>
													<xsl:call-template name="paymentPeriod">
														<xsl:with-param name="srcChargePeriod" select="charge-period"/>
														<xsl:with-param name="srcChargeYear" select="charge-year"/>
													</xsl:call-template>
												</paymentPeriod>
												<paymentFrequency>
													<xsl:call-template name="payFrequency">
														<xsl:with-param name="srcPayFrequency" select="initial-type"/>
													</xsl:call-template>
												</paymentFrequency>
												<topup>
													<xsl:choose>
														<xsl:when test="total-topup-prem = 0"/>
														<xsl:otherwise>
															<xsl:value-of select="total-topup-prem"/>元</xsl:otherwise>
													</xsl:choose>
												</topup>
												<masterPremium>
													<xsl:value-of select="discount-prem"/>元</masterPremium>
												<xsl:choose>
													<xsl:when test="product-cashvalues/product-cashvalue/cash-value != ''">
														<hasCashValues>Y</hasCashValues>
														<cashCount>
															<xsl:value-of select="count(product-cashvalues/product-cashvalue)"/>
														</cashCount>
													</xsl:when>
													<xsl:otherwise>
														<hasCashValues>N</hasCashValues>
														<cashCount>0</cashCount>
													</xsl:otherwise>
												</xsl:choose>
												<cashValues>
													<xsl:for-each select="product-cashvalues/product-cashvalue">
														<cashValue>
															<endYear>
																<xsl:value-of select="cash-year"/>
															</endYear>
															<svCash>
																<xsl:value-of select="cash-value"/>
															</svCash>
														</cashValue>
													</xsl:for-each>
												</cashValues>
												<xsl:choose>
													<xsl:when test="product-cashvalues/rbindicator = 'Y'">
														<hasRbBenefit>Y</hasRbBenefit>
														<benefitCount>
															<xsl:value-of select="count(product-cashvalues/product-cashvalue)"/>
														</benefitCount>
														<rbBenefits>
															<xsl:for-each select="product-cashvalues/product-cashvalue">
																<rbBenefit>
																	<endYear>
																		<xsl:value-of select="cash-year"/>
																	</endYear>
																	<rbRate>
																		<xsl:value-of select="rb-cash-value"/>
																	</rbRate>
																</rbBenefit>
															</xsl:for-each>
														</rbBenefits>
													</xsl:when>
													<xsl:otherwise>
														<hasRbBenefit>N</hasRbBenefit>
														<benefitCount>0</benefitCount>
														<rbBenefits> 
	</rbBenefits>
													</xsl:otherwise>
												</xsl:choose>
											</xsl:when>
										</xsl:choose>
									</xsl:for-each>
								</policy>
							</policys>
							<riders>
								<xsl:for-each select="products/product">
									<xsl:choose>
										<xsl:when test="ins-type != 1">
											<rider>
												<universal>
													<xsl:value-of select="is-universal"/>
												</universal>
												<xsl:choose>
													<xsl:when test="substring(string(/insupost-response/response-policy-query/policy-query-info-list/policy-query-info/policy-info/apply-code),16,2) = '37'">
														<productCode>
															<xsl:value-of select="product-num"/>
														</productCode>
													</xsl:when>
													<xsl:otherwise>
														<productCode>
															<xsl:value-of select="product-code"/>
														</productCode>
													</xsl:otherwise>
												</xsl:choose>
												<productName>
													<xsl:value-of select="product-name"/>
												</productName>
												<deductible>
													<xsl:value-of select="deduct-info"/>
												</deductible>
												<paymentRate>
													<xsl:value-of select="concat(pay-rate*100,'%')"/>
												</paymentRate>
												<sa>
													<xsl:value-of select="amount"/>元</sa>
												<units>
													<xsl:value-of select="unit"/>份</units>
												<topup>
													<xsl:value-of select="total-topup-prem"/>元</topup>
												<riderPremium>
													<xsl:value-of select="discount-prem"/>元</riderPremium>
												<coveragePeriod>
													<xsl:call-template name="coveragePeriod">
														<xsl:with-param name="srcCoveragePeriod" select="coverage-period"/>
														<xsl:with-param name="srcCoverageYear" select="coverage-year"/>
													</xsl:call-template>
												</coveragePeriod>
												<paymentPeriod>
													<xsl:call-template name="paymentPeriod">
														<xsl:with-param name="srcChargePeriod" select="charge-period"/>
														<xsl:with-param name="srcChargeYear" select="charge-year"/>
													</xsl:call-template>
												</paymentPeriod>
												<xsl:choose>
													<xsl:when test="product-cashvalues/product-cashvalue/cash-value != ''">
														<hasCashValues>Y</hasCashValues>
														<cashCount>
															<xsl:value-of select="count(product-cashvalues/product-cashvalue)"/>
														</cashCount>
													</xsl:when>
													<xsl:otherwise>
														<hasCashValues>N</hasCashValues>
														<cashCount>0</cashCount>
													</xsl:otherwise>
												</xsl:choose>
												<cashValues>
													<xsl:for-each select="product-cashvalues/product-cashvalue">
														<cashValue>
															<endYear>
																<xsl:value-of select="cash-year"/>
															</endYear>
															<svCash>
																<xsl:value-of select="cash-value"/>
															</svCash>
														</cashValue>
													</xsl:for-each>
												</cashValues>
												<xsl:choose>
													<xsl:when test="product-cashvalues/rbindicator = 'Y'">
														<hasRbBenefit>Y</hasRbBenefit>
														<benefitCount>
															<xsl:value-of select="count(product-cashvalues/product-cashvalue)"/>
														</benefitCount>
														<rbBenefits>
															<xsl:for-each select="product-cashvalues/product-cashvalue">
																<rbBenefit>
																	<endYear>
																		<xsl:value-of select="cash-year"/>
																	</endYear>
																	<rbRate>
																		<xsl:value-of select="rb-cash-value"/>
																	</rbRate>
																</rbBenefit>
															</xsl:for-each>
														</rbBenefits>
													</xsl:when>
													<xsl:otherwise>
														<hasRbBenefit>N</hasRbBenefit>
														<benefitCount>0</benefitCount>
														<rbBenefits> 
	</rbBenefits>
													</xsl:otherwise>
												</xsl:choose>
											</rider>
										</xsl:when>
									</xsl:choose>
								</xsl:for-each>
							</riders>
							<twoDimenCode>
								<xsl:value-of select="two-dimen-code"/>
							</twoDimenCode>
						</policyPrint>
					</xsl:for-each>
				</xsl:when>
				<xsl:otherwise/>
			</xsl:choose>
		</return>
	</xsl:template>
	<xsl:template name="gender">
		<xsl:param name="srcGender"/>
		<xsl:choose>
			<xsl:when test="$srcGender = 'M'">男</xsl:when>
			<xsl:when test="$srcGender = 'F'">女</xsl:when>
			<xsl:otherwise>未知</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="payFrequency">
		<xsl:param name="srcPayFrequency"/>
		<xsl:choose>
			<xsl:when test="$srcPayFrequency = '1'">年交</xsl:when>
			<xsl:when test="$srcPayFrequency = '2'">半年交</xsl:when>
			<xsl:when test="$srcPayFrequency = '3'">季交</xsl:when>
			<xsl:when test="$srcPayFrequency = '4'">月交</xsl:when>
			<xsl:when test="$srcPayFrequency = '5'">趸交</xsl:when>
			<xsl:otherwise>未知</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="coveragePeriod">
		<xsl:param name="srcCoveragePeriod"/>
		<xsl:param name="srcCoverageYear"/>
		<xsl:choose>
			<xsl:when test="$srcCoveragePeriod = '1'">终身</xsl:when>
			<xsl:when test="$srcCoveragePeriod = '2'">
				<xsl:value-of select="string($srcCoverageYear)"/>年</xsl:when>
			<xsl:when test="$srcCoveragePeriod = '3'">至<xsl:value-of select="string($srcCoverageYear)"/>周岁</xsl:when>
			<xsl:otherwise>未知</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="paymentPeriod">
		<xsl:param name="srcChargePeriod"/>
		<xsl:param name="srcChargeYear"/>
		<xsl:choose>
			<xsl:when test="$srcChargePeriod = '1'">--</xsl:when>
			<xsl:when test="$srcChargePeriod = '2'">
				<xsl:value-of select="string($srcChargeYear)"/>年</xsl:when>
			<xsl:when test="$srcChargePeriod = '3'">缴至<xsl:value-of select="string($srcChargeYear)"/>周岁</xsl:when>
			<xsl:otherwise>未知</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
</xsl:stylesheet>
